<div class="row">
    <div class="col-md-2">
        <h2><kbd><?php echo __('Actions'); ?></kbd></h2>
        <hr/>
        <ul class="nav nav-stacked">
            <li><?php echo $this->Html->link(__('Edit Wallet'), array('action' => 'edit', $wallet['Wallet']['id'])); ?> </li>
            <li><?php echo $this->Form->postLink(__('Delete Wallet'), array('action' => 'delete', $wallet['Wallet']['id']), null, __('Are you sure you want to delete # %s?', $wallet['Wallet']['id'])); ?> </li>
            <li><?php echo $this->Html->link(__('List Wallets'), array('action' => 'index')); ?> </li>
            <li><?php echo $this->Html->link(__('New Wallet'), array('action' => 'add')); ?> </li>
            <li><?php echo $this->Html->link(__('List Users'), array('controller' => 'users', 'action' => 'index')); ?> </li>
            <li><?php echo $this->Html->link(__('New User'), array('controller' => 'users', 'action' => 'add')); ?> </li>
            <li><?php echo $this->Html->link(__('List Transactions'), array('controller' => 'transactions', 'action' => 'index')); ?> </li>
            <li><?php echo $this->Html->link(__('New Transaction'), array('controller' => 'transactions', 'action' => 'add')); ?> </li>
        </ul>
    </div>
    <div class="col-md-10">
        <div>
            <h2><kbd><?php echo __('Wallet'); ?></kbd></h2>
            <hr/>
            <table class="table table-bordered">
                <tr class="success">
                    <th><?php echo __('Id'); ?></th>
                    <th><?php echo __('User'); ?></th>
                    <th><?php echo __('Name'); ?></th>
                    <th><?php echo __('Current Money'); ?></th>
                    <th><?php echo __('Created'); ?></th>
                    <th><?php echo __('Updated'); ?></th>
                </tr>
                <tr>
                    <td><?php echo h($wallet['Wallet']['id']); ?></td>
                    <td><?php echo $this->Html->link($wallet['User']['username'], array('controller' => 'users', 'action' => 'view', $wallet['User']['id'])); ?></td>
                    <td><?php echo h($wallet['Wallet']['name']); ?></td>
                    <td><?php echo number_format($wallet['Wallet']['current_money']) . " VNĐ"; ?></td>
                    <td><?php echo h($wallet['Wallet']['created']); ?></td>
                    <td><?php echo h($wallet['Wallet']['updated']); ?></td>
                </tr>
            </table>
        </div>

        <div>
            <h3><?php echo __('Related Transactions'); ?></h3><hr/>
            <?php if (!empty($wallet['Transaction'])): ?>
                <table class="table table-bordered">
                    <tr class="info">
                        <th><?php echo __('Category Id'); ?></th>
                        <th><?php echo __('Wallet Id'); ?></th>
                        <th><?php echo __('Parent Id'); ?></th>
                        <th><?php echo __('Money'); ?></th>
                        <th><?php echo __('Created'); ?></th>
                        <th><?php echo __('Updated'); ?></th>
                        <th><?php echo __('With Who'); ?></th>
                        <th><?php echo __('Action'); ?></th>

                    </tr>
                    <?php foreach ($wallet['Transaction'] as $transaction): ?>
                        <tr>
                            <td><?php echo $transaction['category_id']; ?></td>
                            <td><?php echo $transaction['wallet_id']; ?></td>
                            <td><?php echo $transaction['parent_id']; ?></td>
                            <td><?php echo number_format($transaction['money']) . " VNĐ"; ?></td>
                            <td><?php echo $transaction['created']; ?></td>
                            <td><?php echo $transaction['updated']; ?></td>
                            <td><?php echo $transaction['with_who']; ?></td>
                            <td class="actions">
                                <?php echo $this->Html->link(__('View'), array('controller' => 'transactions', 'action' => 'view', $transaction['id']), array('class' => 'btn-sm btn-info')); ?>
                                <?php echo $this->Html->link(__('Edit'), array('controller' => 'transactions', 'action' => 'edit', $transaction['id']), array('class' => 'btn-sm btn-warning')); ?>
                                <?php echo $this->Form->postLink(__('Delete'), array('controller' => 'transactions', 'action' => 'delete', $transaction['id']), array('class' => 'btn-sm btn-danger'), __('Are you sure you want to delete # %s?', $transaction['id'])); ?>
                            </td>
                        </tr>
                    <?php endforeach; ?>
                </table>
            <?php endif; ?>

            <div class="actions">
                <ul>
                    <li class="btn"><?php echo $this->Html->link(__('New Transaction'), array('controller' => 'transactions', 'action' => 'add'), array('class' => 'btn btn-success')); ?> </li>
                </ul>
            </div>
        </div>
    </div>

</div>


